import axios from '@/libs/api.request';

export function fetch(data) {
  return axios.request({
    url: 'demos',
    method: 'GET',
    data
  });
}

export function fetchOne(id) {
  return axios.request({
    url: `demos/${id}`,
    method: 'POST'
  })
}

export function add(data) {
  return axios.request({
    url: 'demos',
    method: 'POST',
    data
  })
}

export function update(data) {
  return axios.request({
    url:'demos',
    method:'put',
    data
  })
}

export function dele(id) {
  return axios.request({
    url: 'demos',
    method: 'DELETE',
    data: {
      id
    }
  })
}
